
import request from '@/utils/request'

// request
/***************************************************** store ****************************************************/

/**
 * 获取门店列表
 */
export const getStoreListApi: IGetStoreListApi = function(data) {
    return request.get(`htscrm/admin/index/store`, data, { showErrorMessage: false }) as ReturnType<IGetStoreListApi>
}


/**
 * 获取当前账户的下级门店列表
 */
export const getStoreTreeApi: IGetStoreTreeApi = function(data) {
    return request.get(`htscrm/admin/store_tree`, data, { showErrorMessage: false }) as ReturnType<IGetStoreTreeApi>
}


/**
 * 获取门店信息
 */
export const getStoreInfoApi: IGetStoreInfoApi = function() {
    return request.get(`htscrm/admin/store_info`, {}, { showErrorMessage: false }) as ReturnType<IGetStoreInfoApi>
}



/**
 * 获取门店登录信息
 */
export const getStoreLoginInfoApi: IGetStoreLoginInfoApi = function(id) {
    return request.get(`htscrm/admin/index/sub_login/${id}`, {}, { showErrorMessage: false }) as ReturnType<IGetStoreLoginInfoApi>
}

/**
 * 转移门店用户
 */
export const transferStoreUserApi: ITransferStoreUserApi = function(data) {
    return request.post(`htscrm/admin/index/store_transfer`, data, { showErrorMessage: false }) as ReturnType<ITransferStoreUserApi>
}

/**
 * 添加门店
 */
export const addStoreApi: IAddStoreApi = function(data) {
    return request.post(`htscrm/admin/index/store_add`, data, { showErrorMessage: false }) as ReturnType<IAddStoreApi>
}

/**
 * 获取门店财务记录
 */
export const getStoreMoneyLogApi: IGetStoreMoneyLogApi = function(data) {
    return request.post(`htscrm/admin/index/store_money_log`, data, { showErrorMessage: false }) as ReturnType<IGetStoreMoneyLogApi>
}


/**
 * 转移门店金额
 */
export const transferStoreMoneyApi: ITransferStoreMoneyApi = function(data) {
    return request.post(`htscrm/admin/index/money_transfer`, data, { showErrorMessage: true }) as ReturnType<ITransferStoreMoneyApi>
}

/**
 * 门店充值
 */
export const storeRechargeApi: IStoreRechargeApi = function(data) {
    return request.post(`htscrm/admin/index/recharge`, data, { showErrorMessage: true }) as ReturnType<IStoreRechargeApi>
}

